API Documentation
Public Member Functions | List of all members
nkWinUi::TreeView::Item Class Reference

Holds information of a tree view item. More...

Public Member Functions

 Item ()
 
virtual ~Item ()
 
ItemaddChild (Item *child)
 
ItemgetChild (unsigned int index) const
 
void disavowChild (Item *child)
 
void setText (const std::string_view &text)
 
std::string_view getText () const
 
void setParentTree (TreeView *parent)
 
TreeViewgetParentTree () const
 
void setParentItem (Item *item)
 
ItemgetParentItem () const
 
void setPrecedingItem (Item *item)
 
ItemgetPrecedingItem () const
 
void setAttachedData (void *data)
 
void * getAttachedData () const
 
void exportIntrospection (nkExport::Node *rootNode)
 

Detailed Description

Holds information of a tree view item.

Constructor & Destructor Documentation

◆ Item()

nkWinUi::TreeView::Item::Item ( )

Constructor.

◆ ~Item()

virtual nkWinUi::TreeView::Item::~Item ( )
virtual

Destructor.

Member Function Documentation

◆ addChild()

Item* nkWinUi::TreeView::Item::addChild ( Item child)

Adds a child item.

Parameters
childThe item to add as a child.
Returns
The item provided.

◆ getChild()

Item* nkWinUi::TreeView::Item::getChild ( unsigned int  index) const
Parameters
indexThe index of the item wanted.
Returns
The child associated to given index if available, nullptr else.

◆ disavowChild()

void nkWinUi::TreeView::Item::disavowChild ( Item child)

Makes the item forget about a child.

Parameters
childThe item to forget.

◆ setText()

void nkWinUi::TreeView::Item::setText ( const std::string_view &  text)

Sets the text displayed for the item.

Parameters
textThe text to show.

◆ getText()

std::string_view nkWinUi::TreeView::Item::getText ( ) const
Returns
Currently displayed text.

◆ setParentTree()

void nkWinUi::TreeView::Item::setParentTree ( TreeView parent)

Sets the parent tree view.

Parameters
parentThe parent window to set.

◆ getParentTree()

TreeView* nkWinUi::TreeView::Item::getParentTree ( ) const
Returns
The parent tree view.

◆ setParentItem()

void nkWinUi::TreeView::Item::setParentItem ( Item item)

Sets the parent item, if any.

Parameters
itemThe parent item to set.

◆ getParentItem()

Item* nkWinUi::TreeView::Item::getParentItem ( ) const
Returns
The current parent item.

◆ setPrecedingItem()

void nkWinUi::TreeView::Item::setPrecedingItem ( Item item)

Sets the preceding item in the tree view.

Parameters
itemThe item that should be preceding in the tree view.

◆ getPrecedingItem()

Item* nkWinUi::TreeView::Item::getPrecedingItem ( ) const
Returns
Currently preceding item in the tree view.

◆ setAttachedData()

void nkWinUi::TreeView::Item::setAttachedData ( void *  data)

Sets user data attached to the item.

Parameters
dataThe data to attach.
Remarks
The item does not own the user data attached.

◆ getAttachedData()

void* nkWinUi::TreeView::Item::getAttachedData ( ) const
Returns
Currently attached user data.

◆ exportIntrospection()

void nkWinUi::TreeView::Item::exportIntrospection ( nkExport::Node rootNode)

Basic export capabilities.

Parameters
rootNodeThe tree to export into.

The documentation for this class was generated from the following file: